<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>getVM</title>
    <script type="text/javascript" src="resource/js/jquery-2.1.1.min.js"></script>
    <link type="text/css" rel="stylesheet" href="resource/css/bootstrap.min.css"/>
    <script type="text/javascript">
        $(function () {
            details = {
                "P1G1": "OS : Redhat6.3, CPU : 64, Memory : 80G, Volume Size: 250G",
                "P1G2": "OS : Redhat6.2, CPU : 64, Memory : 80G, Volume Size: 250G",
                "CouchbaseVM": "OS : Redhat6.1, CPU : 64, Memory : 80G, Volume Size: 250G",
                "ArbiterVM": "OS : Redhat6.0, CPU : 64, Memory : 80G, Volume Size: 250G",
            }
            $("#HardwareType").bind("change", function () {
                $("#HardwareDetails").text(details[$(this).val()]);
            });
            $('#HardwareType').val("P1G1").change();
            $.get("resource/data/password.txt", function(data) {
                has_token = JSON.parse(data);
                $("#user").val(has_token["user"]).attr("readonly", "readonly");
                console.log(has_token['CorpPassword']);
                console.log(has_token['RSAPassword']);
                if (has_token['CorpPassword'] == 'true'){
                    $("#passworddiv").hide()
                }
                if (has_token['RSAPassword'] == 'true'){
                    $("#rsadiv").hide()
                }
            });
        })
    </script>
</head>
<body>
<div style="margin: 60px">
    <div class="alert alert-warning" style="width: 80%;">You need to be member of DL X to apply a P1GX machine, go to {link} to join that group</div>
    <form class="form-horizontal">
        <div class="form-group">
            <label for="DBtype" class="col-sm-2 control-label">DB Type</label>

            <div class="col-sm-2">
                <select class="form-control" id="DBtype">
                    <option value="mongodb" selected="selected">mongodb</option>
                    <option value="cassandra">cassandra</option>
                    <option value="couchbase">couchbase</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="DataCenter" class="col-sm-2 control-label">Data Center</label>

            <div class="col-sm-2">
                <select class="form-control" id="DataCenter">
                    <option value="SLC" selected="selected">SLC</option>
                    <option value="PHX">PHX</option>
                    <option value="LVS">LVS</option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="HardwareType" class="col-sm-2 control-label">Hardware Type</label>


            <div class="col-sm-2">
                <select class="form-control" id="HardwareType">
                    <option value="P1G1">P1G1</option>
                    <option value="P1G2">P1G2</option>
                    <option value="CouchbaseVM">CouchbaseVM</option>
                    <option value="ArbiterVM">ArbiterVM</option>
                </select>
            </div>
            <p id="HardwareDetails" class="text-info" style="margin-top: 7; font-weight: 600"></p>
        </div>


        <div class="form-group">
            <label for="reason" class="col-sm-2 control-label">Reason</label>

            <div class="col-sm-3">
                <input type="text" class="form-control" id="reason">
            </div>
        </div>

        <div class="form-group">
            <label for="user" class="col-sm-2 control-label">User</label>

            <div class="col-sm-3">
                <input type="text" class="form-control" id="user">
            </div>
        </div>
        <div class="form-group" id="passworddiv">
            <label for="password" class="col-sm-2 control-label">Password</label>

            <div class="col-sm-3">
                <input type="password" class="form-control" id="password" placeholder="CORP Password">
            </div>
        </div>
        <div class="form-group" id="rsadiv">
            <label for="RSAToken" class="col-sm-2 control-label">RSA Token</label>

            <div class="col-sm-3">
                <input type="password" class="form-control" id="RSAToken">
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary">Send</button>
            </div>
        </div>
    </form>
</div>
</body>
</html>